<#import "/freemarker/modeltype.ftl" as mt>
<#import "/freemarker/modeltype_entity.ftl" as mte>
<div class="widget-header">
		<h3 class="title"><i class="fontello-icon-th-list-1"></i> 编辑申请信息</h3>
</div>
<div class="widget" >
	<div class="widget-content">
		<form id="editForm">
			<table class="table table-bordered animate2 fadeInUp" style="width:400px; text-align:left;">
				<tr>
					<th class="table-left" style="width:60px;">标题</th>
					<td><input type="text" id="title" name="title" value="${(apply.title)!''}" placeholder="标题可自动生成 无需填写"/>
						<input type="hidden" id="code" name="code" value="${(apply.code)!''}" /></td>
				</tr>
				<tr>
					<th class="table-left" style="width:60px;">备注(用车时间和原因及其他)</th>
					<td><textarea id="remark" name="remark" >${(apply.remark)!''}</textarea></td>
				</tr>
			</table>
			<table style="width:400px; margin-top:10px;" class="table table-bordered animate2 fadeInUp">
				<thead>
					<tr>
						<th style="text-align:center; width:120px;">车辆类型<a href="javascript:;" onclick="javascript:add_vehicleApply();return false;" style="margin-left: 20px">[添加空白行]</a></th>
						<th style="text-align:center; width:40px;">数量</th>
						<th style="width:32px;">操作</th>
					</tr>
				</thead>
				<tbody id="ListBody">
					<#assign i = 0 />
					<#if ((apply.adList)?? && apply.adList?size > 0)>
					<#list apply.adList as item>
					<tr class="rep">
						<td><div class="input-append">
								<input class="vtn" id="vtn_${i}" name="adList[${i}].vtn" value="${(item.vtn)!''}" type="text" style="width:200px;" readonly />
								<button class="btn btn-xs btn-primary" pib="${i}" type="button" onclick="javascript:select_vehicleApply($(this));return false;"><i class="icon-search"></i></button>
							</div>
							<input class="vtc" id="vtc_${i}" name="adList[${i}].vtc" value="${(item.vtc)!''}" type="hidden" /></td>
						<td><input class="cou" type="text" name="adList[${i}].count" value="${(item.count)!''}" onblur="javascript:createTitle_vehicleApply();return false;" style="width:40px;"/></td>
						<td style="text-align:center;"><a class="btn btn-danger" href="javascript:;" onclick="javascript:delete_vehicleApply($(this));return false;"><i class="icon-remove"></i></a></td>
					</tr>
					<#assign i = i + 1/></#list><#else>
					<tr class="rep">
						<td><div class="input-append">
								<input class="vtn" id="vtn_${i}" name="adList[${i}].vtn" type="text" style="width:200px;" readonly />
								<button class="btn btn-xs btn-primary" pib="${i}" type="button" onclick="javascript:select_vehicleApply($(this));return false;"><i class="icon-search"></i></button>
							</div>
							<input class="vtc" id="vtc_${i}" name="adList[${i}].vtc" type="hidden" /></td>
						<td><input class="cou not-null" type="text" name="adList[${i}].count" style="width:40px;" onblur="javascript:createTitle_vehicleApply();return false;" onkeyup="javascript:checkNum_vehicleApply($(this));"/></td>
						<td style="text-align:center;"><a class="btn btn-danger" href="javascript:;" onclick="javascript:delete_vehicleApply($(this));return false;"><i class="icon-remove"></i></a></td>
					</tr>
					<#assign i = i + 1/></#if>
				</tbody>
				<tr>
					<td colspan="5" style="text-align:center;">
						<#if !(apply.code)??>
						<a class="btn btn-info" href="javascript:;" onclick="javascript:save_vehicleApply();return false;"><i class="icon-save"></i> 保 存</a>
						</#if>
						<a class="btn btn-primary" href="javascript:;" onclick="javascript:sys_load_handle('vehicleApply');return false;"><i class="fontello-icon-block"></i> 取 消</a>
					</td>
				</tr>
			</table>
		</form>
	</div>
</div>
<input type="hidden" id="index" value="${i}" />
<table id="tempTable" style="display:none;">
	<tr class="rep">
		<td><div class="input-append">
				<input class="vtn" type="text" style="width:200px;" readonly />
				<button class="btn btn-xs btn-primary" type="button" onclick="javascript:select_vehicleApply($(this));return false;"><i class="icon-search"></i></button>
			</div>
			<input class="vtc" type="hidden" /></td>
		<td><input class="cou" type="text" style="width:40px;" onblur="javascript:createTitle_vehicleApply();" onkeyup="javascript:checkNum_vehicleApply($(this)); return false;"/></td>
		<td style="text-align:center;"><a class="btn btn-danger" href="javascript:;" onclick="javascript:delete_vehicleApply($(this));return false;"><i class="icon-remove"></i></a></td>
	</tr>
</table>
